fn main() {
	// an array is a collection of data elements of the same type
	// an array literal is a list of expressions surrounded by square brackets
	// an individual element can be accessed using an index expression, where indexes start from 0	
	mut nums := [1, 2, 3]
	println(nums)    // `[1, 2, 3]`
	println(nums[0]) // `1`
	println(nums[1]) // `2`

	nums[1] = 5
	println(nums) // `[1, 5, 3]`

	// use push operator << to append an element to the end of an array
	// it can also append an entire array
	nums << 4
	println(nums) // "[1, 5, 3, 4]"

	// append array
	nums << [5, 6, 7]
	println(nums) // "[1, 5, 3, 4, 5, 6, 7]"
	
	mut names := ['John']
	names << 'Peter'
	names << 'Sam'
	// names << 10  // not compile. `names` is an array of strings.
	
	// val in array: returns true if the array contains val
	println('Alex' in names) // "false"
}
